package com.fg.pro.trade.entity;

import java.util.Date;

import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;

/**
 * 订单详情(TradeOrderDetail)表实体类
 *
 * @author makejava
 * @since 2025-08-17 10:01:50
 */
@SuppressWarnings("serial")
@Data
public class TradeOrderDetail extends Model<TradeOrderDetail> {
    //主键
    private Long id;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date createTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date updateTime;
    //收货日期
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date receiveTime;
    //订单id
    private Long orderId;
    //订单详细类型 1：表示下单时刻购物车里展示的商品详情 2：组合商品时候，表示TYPE_RAW_DETAIL按照基本单位合并的商品
    private Integer orderDetailType;

    private Long orderDetailGroupId;
    //站点
    private Long orderDetailStationId;
    //商品ID
    private Long skuId;
    //用于区分原料属于哪个组合商品
    private Long orderDetailDetailRandomId;
    //加单总金额
    private Double orderDetailTotalAddOrderPrice;
    //套账下单金额
    private Double orderDetailFakeOrderPrice;
    //套账出库金额
    private Double orderDetailFakeOutstockPrice;
    //是否在配送单打印 0：无 1：是 2：否
    private Integer orderDetailIsPrint;
    //套账数据类型 0：无 1：无套账数据 2：纯套账数据 3：真假都有
    private Integer orderDetailFakeType;
    //下单金额 定价单位单价 * 下单数 + 下单金额补差
    private Double orderDetailOrderPrice;
    // 出库金额=出库金额补差+定价单位单价*出库数
    private Double orderDetailOutstockPrice;
    //销售金额-含税(也就是用户应付金额)：（outstock_price+aftersale+manual_adjust_price）
    private Double orderDetailSalePrice;
    //销售金额-不含税：销售额(舍入的)/(1+税率), 四舍五入至两位小数
    private Double salePriceNoTax;
    //税额：销售额(舍入的)/(1+税率)*税率
    private Double orderDetailTaxPrice;

    private Double orderDetailOutstockCostPrice;
    //分拣状态 0：未使用 1：未称重 2：已称重 3：缺货
    private Integer orderDetailSortingStatus;
    //供应商协作模式 1：仅供货 2：代分拣 4：代配送
    private Integer orderDetailSupplierCooperateModelType;
    //分拣单位
    private Long orderDetailUnitId;
    //sku版本
    private Long orderDetailSkuRevision;
    //定价单位
    private Long orderDetailFeeUnitId;
    //商品名
    private String orderDetailSkuName;
    //自定义编码
    private String orderDetailSkuCustomizeCode;
    //收获客户ID
    private Long orderDetailReceiveCustomerId;
    //参考成本
    private String orderDetailCost;
    //单价，和下单里的一样
    private Double orderDetailFeePrice;
    //需取出,默认都是需取出 0：无 1：是 2：否
    private Integer orderDetailIsNeedTakeOut;
    //客户名
    private String orderDetailReceiveCustomerName;
    //供应商ID
    private Long orderDetailSupplierId;
    //一级分类
    private Long orderDetailCategoryFirId;
    //二级分类
    private Long orderDetailCategorySecId;
    //一级分类名
    private String orderDetailCategoryFirName;
    //二级分类名
    private String orderDetailCategorySecName;
    //出库状态 0：无 1：待出库 2：部分出库 3：已出库
    private Integer orderDetailOutstockState;
    //订单号
    private String orderDetailSerialNo;
    //出库数
    private Double orderDetailOutstockUnitQuantity;
    //出库单位ID
    private Long orderDetailOutstockUnitId;
    //出库数（基本单位）
    private Double orderDetailOutstockBaseUnitQuantity;
    //出库单位ID（基本单位）
    private Long orderDetailOutstockBaseUnitId;
    //验货数
    private Integer orderDetailAcceptValueQuantity;
    //下单原价,只会在CreateOrder时从报价单获取一次，不在报价单的默认下单时的单价
    private Double orderDetailOriginalPrice;
    //下单原定价单位,只会在CreateOrder时从报价单获取一次，不在报价单的默认下单时的单价
    private Long orderDetailOriginalUnitId;
    //下单时刻的折扣率，单价/原价，只存原始数据，未换算成百分数
    private Integer orderDetailOriginalRate;
    //下单数，order_unit_value_v2对应
    private Double orderUnitQuantity;
    //风险类型：0-未检测，1-正常，2-异常
    private Integer orderDetailRiskType;
    //风险描述
    private String orderDetailRiskDes;

    private Double orderDetailTax;

    /**
     * 获取主键值
     *
     * @return 主键值
     */
    @Override
    public Serializable pkVal() {
        return this.id;
    }
}

